package com.example.springbootdemo;

import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;

/**
 * @Author: zhangrongqing
 * @Date: 2020/5/20 12:17
 */
public class DateDemo {
    public static void main(String[] args) {
        Date now = new Date();
        Instant instant = Instant.ofEpochMilli(now.getTime());
        LocalDate today = LocalDateTime.ofInstant(instant, ZoneId.systemDefault()).toLocalDate();
        System.out.println(Date.from(today.atStartOfDay(ZoneId.systemDefault()).toInstant()));

    }
}
